package com.example.demo.Service.StudentService;

import com.example.demo.Dao.ScoreDao;
import com.example.demo.Model.score;
import com.example.demo.Repository.ScoreRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ScoreServiceImpl implements ScoreService {
    @Autowired
    private ScoreRepository scorepository;
    private ScoreDao scodao;
    @Override
    public List<score> findAll() {
        return scorepository.findAll();
    }

    @Override
    public score findByStuID(String stuID) {
        return scorepository.findByStuID(stuID);
    }

    @Override
    public void save(score sco) {
        scorepository.save(sco);
    }

    @Override
    public void deletescore(String coID, String stuID) {
        scodao.deletescore(coID,stuID);
    }


//    @Override
//    public boolean selectrow(String coID, String stuID) {
//        if (scodao.selectsame(coID,stuID).equals(0)){
//            return true;
//        }else {
//            return false;
//        }
//    }
}
